package zhang.lao.console.controller.wn.report;/**
 * Created by zhangqin on 2017/10/18.
 */

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zhang.lao.build.mybatis.jdbc.auto.model.*;
import zhang.lao.console.constant.ConsoleUserConstant;
import zhang.lao.dao.base.*;
import zhang.lao.pojo.console.ConsoleContext;
import zhang.lao.pojo.console.resp.HttpResult;
import zhang.lao.pojo.console.resp.HttpResultUtil;
import zhang.lao.service.console.ReportService;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author
 * @create 2017-10-18 14:21
 **/

@Controller

public class CommonReport {


    @Resource
    private ReportService reportService;

    @RequestMapping("/console/report/resource")
    public @ResponseBody HttpResult getResourceCount(ConsoleContext consoleContext){

        return HttpResultUtil.buildSuccess(reportService.resourceReport(consoleContext.getFarms()));
    }
}
